﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections;
using DBXml;

namespace DBXmlTest
{
    [TestClass]
    public class AlphanumComparatorFastTest
    {
        [TestMethod]
        public void TestAlphanumComparatorFastDigits()
        {
            string[] highways = new string[]
            {
                "100F",
                "50F",
                "SR100",
                "SR9"
            };

            int len = highways.Length;
            string[] highwaysSort = new string[len];
            Array.Copy(highways, highwaysSort, len);

            Array.Sort(highwaysSort, new AlphanumComparatorFast().Compare);

            Assert.AreEqual("50F", highwaysSort[0]);
            Assert.AreEqual("100F", highwaysSort[1]);
            Assert.AreEqual("SR9", highwaysSort[2]);
            Assert.AreEqual("SR100", highwaysSort[3]);
        }
    }
}
